package cn.ytnet.shangyun.service.basic.entity;

import org.springframework.stereotype.Component;

import javax.persistence.*;

/**
 * Created by cyongk on 2015/12/8.
 * ClassName：GoodsStockEntity
 * ChineseName：商品库存数类
 */
@Component("goodsStockEntity")
@Entity
@Table(name = "T_GoodsStock", schema = "crebas", catalog = "")
public class GoodsStockEntity {
    private String pkTGoodsstockId;
    private String stockInventoryQuantity;

    @Id
    @Column(name = "pk_T_goodsstock_id", nullable = false, length = 32)
    public String getPkTGoodsstockId() {
        return pkTGoodsstockId;
    }

    public void setPkTGoodsstockId(String pkTGoodsstockId) {
        this.pkTGoodsstockId = pkTGoodsstockId;
    }

    @Basic
    @Column(name = "stock_inventory_quantity", nullable = false, length = 10)
    public String getStockInventoryQuantity() {
        return stockInventoryQuantity;
    }

    public void setStockInventoryQuantity(String stockInventoryQuantity) {
        this.stockInventoryQuantity = stockInventoryQuantity;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        GoodsStockEntity that = (GoodsStockEntity) o;

        if (pkTGoodsstockId != null ? !pkTGoodsstockId.equals(that.pkTGoodsstockId) : that.pkTGoodsstockId != null)
            return false;
        return stockInventoryQuantity != null ? stockInventoryQuantity.equals(that.stockInventoryQuantity) : that.stockInventoryQuantity == null;

    }

    @Override
    public int hashCode() {
        int result = pkTGoodsstockId != null ? pkTGoodsstockId.hashCode() : 0;
        result = 31 * result + (stockInventoryQuantity != null ? stockInventoryQuantity.hashCode() : 0);
        return result;
    }
}
